package com.xinchen.aiowaste.ui.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.ImageView
import androidx.activity.viewModels
import androidx.lifecycle.Observer
import com.maple.utils.const.ConstKey
import com.xinchen.aiowaste.R
import com.xinchen.aiowaste.base.BaseActivity
import com.xinchen.aiowaste.vm.StorageViewModel

class OutStorageActivity : BaseActivity() {

    private var ivProvinceIn: ImageView? = null
    private var ivProvinceOut: ImageView? = null

    private val viewModel by viewModels<StorageViewModel>()

    override fun getLayoutId(): Int = R.layout.activity_out_storage

    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
        setTitle("出库管理")
        showClockTime()
        onBackClick()

        ivProvinceIn = findViewById(R.id.iv_province_in)
        ivProvinceOut = findViewById(R.id.iv_province_out)
        ivProvinceIn?.setOnClickListener {
            onStartActivity(TransferProvinceInActivity::class.java)
        }
        ivProvinceOut?.setOnClickListener {
           //  onStartActivity(TransferProvinceOutActivity::class.java)
            showToast("开发中")
        }
    }
    override fun initData(savedInstanceState: Bundle?) {
        viewModel.defUI.showDialog.observe(this, Observer {
            showLoading()
        })

        viewModel.defUI.dismissDialog.observe(this, Observer {
            dismissLoading()
        })

        viewModel.defUI.toastEvent.observe(this, Observer {
            showToast(it)
        })
    }
}